<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/global.jsp"%>
<html>
<head>
    <title>社区</title>
    <link rel="stylesheet" type="text/css" href="${staticPath}/resources/css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="${staticPath}/resources/css/bbs.css"/>
    <link rel="stylesheet" type="text/css" href="${staticPath}/resources/css/down.css">
    <%@include file="/common/com.jsp"%>
    <script type="text/javascript" src="${staticPath}/resources/js/ip.js"></script>
    <!-- uediter相关的js开始   -->
    <script type="text/javascript" charset="utf-8" src="${staticPath}/resources/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${staticPath}/resources/js/ueditor/ueditor.all.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="${staticPath}/resources/js/ueditor/lang/zh-cn/zh-cn.js"></script>
    <!-- uediter相关的js结束   -->
</head>
<body>


<!-- 顶端top头开始-->
<div class="top">
    <div>
        <ul>
            <c:if test="${sessionScope.user==null}" var="u">
                <li class="top_regist"><a href="${path}/front/toregist">注册</a></li>
                <li><a href="${staticPath}/front/tologin">登陆</a><span>|</span></li>
            </c:if>
            <c:if test="${!u}">
                <li><a href="${path}/front/logout">退出</a><span>|</span></li>
                <li class="top_regist"><a href="${path}/user/index">${sessionScope.user.username}</a></li>

            </c:if>
            <li><a href="#">帮助</a><span>|</span></li>
            <li><a href="#">贷款</a><span>|</span></li>
            <li><a href="#">理财</a><span>|</span></li>
            <li><a href="${path}/jizhang/index">记账</a><span>|</span></li>
            <%--<li><a href="${path}/index"><img src="${path}/resources/image/icon/home.png"/>首页</a><span>|</span></li>--%>
        </ul>
    </div>

</div>
<!-- 顶端top头结束-->

<!-- 中部 -->
<div class="wrap">
    <!-- 头部导航区 -->
    <div class="nav">
        <div class="nav_left">
            <img src="${path}/resources/image/logo.png"/>
        </div>
        <div class="nav_right">
            <ul>
                <li><a href="#" class="nav_sign">签到</a></li>
                <li><a href="${path}/bbs/towritetopic" class="nav_send_msg">发帖</a></li>
                <li><a href="#">论坛帮助</a></li>
                <li id="nav_li_section" class="nav_li_section"><a href="#" class="nav_section">全部版块</a>
                    <!--全部版块 下拉框div-->


                    <div id="draw_down" class="draw_down">
                        <div class="draw_contrain">

                        <c:forEach items="${allsection}" var="item">
                            <div class="ctn_top">${item}</div>
                            <div class="clearfix" style="margin-bottom: 25px;">
                                <ul style="margin-left:-5px;">
                                    <c:forEach items="${subsection}" var="subitem">
                                        <c:if test="${subitem.sectionType==item}">
                                    <li style="margin:2px 5px;float:left;text-align:left;">
                                       <a href="${path}/bbs/opensection?sid=${subitem.id}">
                                          ${subitem.sname}
                                       </a>
                                    </li>
                                        </c:if>
                                    </c:forEach>
                                </ul>
                            </div>
                        </c:forEach>
                        </div>
                    </div>
                    <div id="shadow_div" class="shadow_div"></div>
                </li>
                <li><a href="${path}/bbs/index">社区首页</a></li>
            </ul>
        </div>
    </div><!-- 头部导航区结束 -->

    <!-- 内容区 -->
    <div class="content">
        <!-- 内容区左边开始-->
        <div class="ct_left">
            <div class="ct_topic">
                <div class="topic_title">
                    <p>${topic.title}</p>
                </div>
                <div class="topic_info clearfix">
                    <div class="info_left">   ${topic.time}
                    </div>
                    <div class="info_right" style="text-align: center;"> 浏览：${topic.clickCount} </div>

                </div>
                <div class="topic_article">

                    <p>
                        ${topic.content}
                    </p>
                    <div class="jubao">
                        <a href="#">
                         <%--   <img src="${path}/resources/image/icon/warning.ico"/>
                            举报--%>
                        </a>
                    </div>
                    <div class="count">
                        <div class="count_left">
                            <ul>
                                <li><%--<img src="${path}/resources/image/icon/comment.ico"/>--%>
                                   <%-- <a href="#">评论</a><span></span></li>--%>
                                <li><%--<img src="${path}/resources/image/icon/like.ico"/>--%>
                                  <%--  <a href="#">点赞</a><span></span></li>--%>
                                <li><%--<img src="${path}/resources/image/icon/star.ico"/>--%>
                                   <%-- <a href="#">收藏</a><span></span></li>--%>
                            </ul>
                        </div>
                        <div class="count_right">
                            <span>分享到</span>
                            <a href="#"><img src="${path}/resources/image/icon/sine.svg"/></a>
                            <a href="#"><img src="${path}/resources/image/icon/zone.svg" /></a>
                            <a href="#"><img src="${path}/resources/image/icon/weixing.svg"/></a>
                        </div>
                    </div>




                </div>


            </div>


            <!--  评论列出区     -->
            <div class="ct_reply">
                <div class="reply_qubu">
                    <span>全部评论</span>
                </div>

                <!-- 评论 ul li   -->
                <div class="reply_list">
                    <ul>
                        <c:forEach items="${firstReplyPage.list}" var="item">
                        <li>
                            <div class="container clearfix">
                                <div class="list_left">
                                    <a href="#">
                                      <%--  <img src="${path}/resources/image/user/avatar.jpg" />--%>
                                        <img src="${path}/upload/${item.pic}"/>
                                    </a>
                                </div>
                                <!--  评论li 右边开始   -->
                                <div class="list_right">
                                    <!--  评论文字头开始  -->
                                    <div class="ls_rt_top">

                                        ${item.username}
                                        <span style="color:#C1C1C1;font-size:15px;">  ${item.replyTime}</span>


                                    </div> <!--  评论文字头结束  -->
                                    <!--  评论文字开始  -->
                                    <div class="ls_rt_middle" style="font-size:15px;">
                                        ${item.content}
                                    </div>  <!--  评论文字结束  -->
                                    <!--  二级回复开始了  -->
                                    <c:forEach items="${secondReplylist}" var="nitem">
                                        <c:if test="${item.id==nitem.pid}">
                                            <div class="2_reply" style="background:#F6F6F6;font-size:12px;height:50px;border-bottom: #E7E7E7 dotted 2px;padding-left:10px;">
                                                <div>
                                                ${nitem.rusername}  <c:if test="${nitem.tousername!=null}" var="fg"><span style="font-weight:bold;">回复 </span>  ${nitem.tousername}：</c:if><c:if test="${!fg}"> ：</c:if>
                                                        ${nitem.content}
                                                </div>
                                                <div style="height: 20px;">
                                                    <div style="width:200px;height:20px;float:right"><span>${nitem.replyTime}</span><a href="${path}/bbs/towritereplysecond?replyUid=${nitem.uid}&id=${item.id}" style="margin-left: 20px;">回复</a> </div>
                                                </div>
                                            </div>   <!-- 二级回复结束了 -->
                                        </c:if>
                                    </c:forEach>

                                    <!--  评论底部开始  -->
                                    <div class="ls_rt_bottom">
                                        <div class="ls_todo">
                                            <ul>
                                                <li>
                                                   <%-- <img src="${path}/resources/image/icon/like.ico"/>
                                                    <a href="#">点赞</a>
                                                    <span></span>--%>
                                                </li>

                                                <li>
                                                 <%--   <img src="${path}/resources/image/icon/warning.ico"/>
                                                    <a href="#">举报</a>
                                                    <span></span>--%>
                                                </li>
                                                <li>
                                                    <img src="${path}/resources/image/icon/comment.ico"/>
                                                    <a href="${path}/bbs/towritereplysecond?id=${item.id}">回复</a>
                                                    <span></span>
                                                </li>
                                            </ul>
                                        </div>
                                    </div> <!--  评论底部结束   -->
                                </div>    <!--  评论li 右边结束   -->
                            </div>
                        </li>
                        </c:forEach>

                    </ul>
                </div>  <!-- 评论 ul li结束   -->


            </div>      <!--   评论列出区结束     -->

            <!-- 页码开始 -->
            <!--在此制作页码的基本结构-->
            <div class="page">
                <c:if test="${firstReplyPage.pageControl.sumPage!=0}" var="pageFlag">
                    <a style="color: #000;background: white;"  class="unaction" >共计：${firstReplyPage.pageControl.sumPage}页/${firstReplyPage.pageControl.sumCount}条记录</a>
                    <a href="${ctx }/bbs/opentopic?currentPage=1&id=${topic.id}">首页</a>
                    <c:if test="${firstReplyPage.pageControl.currentIndex==1}" var="fp">
                        <a style="disabled:true;" class="unaction">上一页</a>
                    </c:if>
                    <c:if test="${!fp}">
                        <a
                                href="${ctx }/bbs/opentopic?currentPage=${firstReplyPage.pageControl.currentIndex-1}&id=${topic.id}">上一页</a>
                    </c:if>

                    <c:forEach begin="${firstReplyPage.pageControl.minPage}" step="1"
                               end="${firstReplyPage.pageControl.maxPage}" var="index">

                        <c:if test="${firstReplyPage.pageControl.currentIndex==index}" var="t">
                            <a class="active">${index}</a>
                        </c:if>
                        <c:if test="${!t}">
                            <a href="${ctx }/bbs/opentopic?currentPage=${index}&id=${topic.id}">${index}</a>
                        </c:if>
                    </c:forEach>

                    <c:if
                            test="${firstReplyPage.pageControl.currentIndex==firstReplyPage.pageControl.sumPage}"
                            var="fp">
                        <a style="disabled:true" class="unaction">下一页</a>
                    </c:if>
                    <c:if test="${!fp}">
                        <a
                                href="${ctx }/bbs/opentopic?currentPage=${firstReplyPage.pageControl.currentIndex+1}&id=${topic.id}">下一页</a>
                    </c:if>
                    <a
                            href="${ctx }/bbs/opentopic?currentPage=${firstReplyPage.pageControl.maxPage}&id=${topic.id}">末页</a>
                </c:if>

                <!-- 总页数是否为零  -->
                <c:if test="${!pageFlag}">
                    <h1>没有记录</h1>
                </c:if>

            </div>
            <!-- 页码结束 -->


            <!-- 写评论区开始    -->
            <div class="ct_write_rpy">

                <form id="form" action="${path}/bbs/writereplyfirst" method="post">
                    <script id="editor" type="text/plain" style="width:800px;height:200px;"></script>
                    <input type="hidden" name="sid" id="sid" value="${topic.sid}"/>
                    <input type ="hidden" name="uid" id="uid" value="${sessionScope.user.id}"/>
                    <input type="hidden" name="tid" id="tid" value="${topic.id}"/>
                    <input type="hidden" id="content" name="content" value=""/>
                </form>

                <div class="rpy_bottom">
                    <a  id="huifuBtn">回复</a>
                </div>

            </div>  <!-- 写评论区结束    -->
        </div><!-- 内容区左边结束-->


        <!-- 内容区右边开始-->

        <div class="ct_right">
            <div class="selfmsg">
                <div class="selfmsg_sub01">
                    <div class="selfmsg_sub01_touxiang">
                        <img src="${path}/upload/${topicuser.pic}"/>

                    </div>
                    <div class="selfmsg_sub01_username">
                        <p>${topicuser.username}</p>
                    </div>
                    <div class="selfmsg_sub01_tianzi">
                        <ul>
                            <li>
                                <a>
                                    <span></span>
                                    <span></span>
                                </a>
                            </li>
                            <li>
                                <a>
                                    <span></span>
                                    <span></span>
                                </a>
                            </li>
                            <li>
                                <a>
                                    <span></span>
                                    <span></span>
                                </a>
                            </li>
                        </ul>
                    </div>
                    <div class="selfmsg_sub01_button">
                       <%-- <a>他的主页</a>
                        <a>发消息</a>--%>
                    </div>
                </div>
            </div>
            <!--滑动的div开始-->
            <div class="fixed" id="fixed">
                <div class="fix_box clearfix">
                    <div class="fix_box_title">
                        <span>相关推介</span>
                    </div>
                    <div class="fix_box_li">
                        <ul>
                            <li><a href="#">2016下半年理财日志（11月已总结）</a></li>
                            <li><a href="#">清姝理财日记</a></li>
                            <li><a href="#">【南海书生的“一五”计划】第一季</a></li>
                            <li><a href="#">免费领现金/实物的站点集合1.0版</a></li>
                            <li><a href="#">欢迎“账族-老账友”进来报道啦！！！！</a></li>
                            <li><a href="">理财社区专门开辟一个版块</a></li>
                        </ul>

                    </div>

                </div>

                <div class="fix_box clearfix">
                    <div class="fix_box_title">
                        <span>热门版块</span>
                    </div>
                    <div class="fix_box_li">
                        <ul>
                            <li><a href="#">2016下半年理财日志（11月已总结）</a></li>
                            <li><a href="#">清姝理财日记</a></li>
                            <li><a href="#">【南海书生的“一五”计划】第一季</a></li>
                            <li><a href="#">免费领现金/实物的站点集合1.0版</a></li>
                            <li><a href="#">欢迎“账族-老账友”进来报道啦！！！！</a></li>
                            <li><a href="">理财社区专门开辟一个版块</a></li>
                        </ul>

                    </div>
                </div>

            </div><!--滑动的div结束-->

        </div>  <!-- 内容区右边结束-->

    </div>  <!-- 内容区结束 -->

</div>  <!-- 中部结束 -->


<!--copyright开始-->
<div class="copyright clearfix" id="copyright">
    <div class="copyright_content">
        <ul>
            <li>关于
                <ul>
                    <li>品牌故事</li>
                    <li>联系我们</li>
                    <li>加入我们</li>
                    <li>版权声明</li>
                </ul>
            </li>
            <li>课程
                <ul>
                    <li>PHP开发</li>
                    <li>前端开发</li>
                    <li>JAVA开发</li>
                    <li>Android开发</li>
                </ul>
            </li>
            <li>关注
                <ul>
                    <li>新浪微博</li>
                    <li>腾讯微博</li>
                    <li>企业微信</li>
                    <li>QQ空间</li>
                </ul>
            </li>
            <li>留言
                <ul>
                    <li>意见反馈</li>
                    <li>问题留言</li>
                    <li>媒体联络</li>
                    <li>在线客服</li>
                </ul>
            </li>
            <li><img src="${path}/resources/image/weixin.png" alt="微信关注" width="30" height="27" />微信关注
                <ul>
                    <li><img src="${path}/resources/image/qrcode.jpg" alt="扫描关官方微信" width="102" height="102" /></li>
                </ul>
            </li>
        </ul>
    </div>
    <!--copyright_content结束-->
</div>  <!--copyright结束-->



<script type="text/javascript">

    $(function(e) {
        startTop = $('.fixed').offset().top;

        mainHeight = $('.ct_left').height();
        fiexedHeight = $('.fixed').height();


        $(window).scroll(function(e){
            scrollLong = $(document).scrollTop();
            var scrollLong = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;

            //	alert(scrollLong);
            if(scrollLong >= 383){
                //alert("sfd");
                $('.fixed').css('position','fixed');

            }else if(scrollLong < 383){

                $('.fixed').css('position','');
            }

            //判断到达底部
            var fixedHeight = $("#fixed").height();

            var copyrightTop = $("#copyright").offset().top;

            if(scrollLong + fixedHeight >= copyrightTop){

                $('.fixed').css('position','');
            }
        })
    });
</script>







<script  type="text/javascript"  src="${path}/resources/js/bbs/bbs_write_1reply.js"></script>

</body>
</html>
